package 数学问题;

import java.util.Scanner;

public class 复数的运算 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String n = scanner.next();
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double a1 = scanner.nextDouble();
        double b1 = scanner.nextDouble();
        if (n.equals("-")){
            System.out.printf("%.2f",a-a1);
            System.out.print("+");
            System.out.printf("%.2f",b-b1);
            System.out.println("i");
        }else if (n.equals("+")){
            System.out.printf("%.2f",a+a1);
            System.out.print("+");
            System.out.printf("%.2f",b+b1);
            System.out.println("i");
        }else if (n.equals("*")){
            System.out.printf("%.2f",a*a1);
            System.out.print("+");
            System.out.printf("%.2f",b*b1);
            System.out.println("i");
        }else {
            System.out.printf("%.2f",a/a1);
            System.out.print("+");
            System.out.printf("%.2f",b/b1);
            System.out.println("i");
        }
    }
}
